package com.roy.HadoopRPCDemo.bean;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

/**
 * 对框架类型服务调用，封装一个统一的返回类型。
 */
public class RPCResBean implements Writable{

	private int opCode = -1;
	
	private String info = "";
	
	public void write(DataOutput out) throws IOException {
		out.writeInt(opCode);
		out.writeUTF(info);
	}


	public void readFields(DataInput in) throws IOException {
		this.opCode = in.readInt();
		this.info=in.readUTF();
	} 

	public String toString() {
		return "resInfo: {'opCode':"+opCode+",'info':"+info+"}";
	}


	public int getOpCode() {
		return opCode;
	}


	public void setOpCode(int opCode) {
		this.opCode = opCode;
	}


	public String getInfo() {
		return info;
	}


	public void setInfo(String info) {
		this.info = info;
	}
	
}
